/* test sizeof cpp */

#include <iostream>
using std::cout;
using std::endl;
typedef struct
{
    int data;
    int age;
    char name[];
} obs;

typedef struct
{
    char a[10];
    int b[10];
    obs *pobs;
} t_Ini;

void test01()
{
    int stu[] = {0, 0, 2, 676};
    cout << "stu address = " << stu << endl;
    int stulen = sizeof(stu) / sizeof(stu[0]);
    cout << "stu lenth = " << stulen << endl;

    char alp[4] = {'I', 'a', 'm', 'u'};
    cout << "address = " << &alp << endl;
    int alplen = sizeof(alp) / sizeof(alp[0]);
    cout << "lenth = " << alplen << endl;
}

template <typename T>
void mySwap(T &a, T &b, T &c)
{
    T temp;
    temp = a;
    a = b;
    b = temp;
    cout << "3 paras template" << endl;
}

template <class T>
void mySwap(T &a, T &b)
{
    T temp;
    temp = a;
    a = b;
    b = temp;
    cout << "template" << endl;
}

void mySwap(int &a, int &b)
{
    int temp;
    temp = a;
    a = b;
    b = temp;
    cout << "func" << endl;
}

void test02()
{
    int a = 10;
    int b = 20;
    char c = 'a';
    mySwap<>(a, b);
    cout << "a = " << a << endl;
    cout << "b = " << b << endl;
}

int main(int argc, char **argv)
{
    // test01();
    test02();
    return 0;
}
